package com.czy.utils;

/**
 * 添加线程局部变量
 */
public class ThreadLocalUtils {
    private static final ThreadLocal<Integer> CURRENT_LOCAL = new ThreadLocal<>();

    //添加用户ID
    public static void setCurrentId(Integer userId){CURRENT_LOCAL.set(userId);}
    //获取用户ID
    public static Integer getCurrentId(){return CURRENT_LOCAL.get();}
    //删除
    public static void remove(){CURRENT_LOCAL.remove();}

}
